//
//  ShippingAddress.swift
//  ShopIOS
//
//  Created by Apple on 2019/7/19.
//  Copyright © 2019 Apple. All rights reserved.
//

import Foundation
import SwiftyJSON

struct mShippingAddressList {
    var ShippingAddress = [mShippingAddress]()
    var Success: String?
    
    init(json: JSON) {
        ShippingAddress = json["ShippingAddress"].arrayValue.compactMap({ mShippingAddress(json: $0)})
        Success = json["Success"].stringValue
    }
}

struct mShippingAddress {
    var Longitude: Int = 0
    var Id: Int = 0
    var shopBranchId: String?
    var UserId: Int = 0
    var AddressDetail: String?
    var Phone: String?
    var Latitude: Int = 0
    var RegionIdPath: String?
    var CanDelive: Bool = false
    var IsQuick: Bool = false
    var IsDefault: Bool = false
    var RegionId: Int = 0
    var MemberInfo: String?
    var RegionFullName: String?
    var Address: String?
    var ShipTo: String?
    
    init(json: JSON) {
        Longitude = json["Longitude"].intValue
        Id = json["Id"].intValue
        shopBranchId = json["shopBranchId"].stringValue
        UserId = json["UserId"].intValue
        AddressDetail = json["AddressDetail"].stringValue
        Phone = json["Phone"].stringValue
        Latitude = json["Latitude"].intValue
        RegionIdPath = json["RegionIdPath"].stringValue
        CanDelive = json["CanDelive"].boolValue
        IsQuick = json["IsQuick"].boolValue
        IsDefault = json["IsDefault"].boolValue
        RegionId = json["RegionId"].intValue
        MemberInfo = json["MemberInfo"].stringValue
        RegionFullName = json["RegionFullName"].stringValue
        Address = json["Address"].stringValue
        ShipTo = json["ShipTo"].stringValue
    }
}

